<%@ page import="java.util.HashMap,common.CommonUtil,java.util.*,common.*" contentType="text/html; charset=utf-8" %>

<%
UserSession userSession = (UserSession)session.getAttribute("user"); 

//String login_id = null;
String user_id = null;
String level = null;
String admin_ent_id = null;

if(userSession!= null){
	//login_id = userSession.getLogin_id();
	user_id = userSession.getUser_id();
	level = userSession.getAdmin_level();
	admin_ent_id = userSession.getEnt_id();
}

HashMap listMap=(HashMap)request.getAttribute("list_map");

HashMap map  = null;
ArrayList list=null;


if (listMap!=null){
    list=(ArrayList)listMap.get("mainContent");
}

String admin_id = null;
String ent_id = null;
String login_id = null;
String login_pw = null;
String login_name = null;
String admin_level = null;
String email = null;
String tel_no = null;
String cell_no = null;
String ent_nm = null;

if(list != null){
	if(list.size() > 0){
		admin_id = (String)((HashMap)list.get(0)).get("admin_id");
		ent_id = CommonUtil.nvl((String)((HashMap)list.get(0)).get("ent_id"));
		login_id = Crypto.DecodeBySType((String)((HashMap)list.get(0)).get("login_id"));
		login_pw = Crypto.DecodeBySType((String)((HashMap)list.get(0)).get("login_pw"));
		login_name = (String)((HashMap)list.get(0)).get("login_name");
		admin_level = (String)((HashMap)list.get(0)).get("admin_level");
		email = CommonUtil.nvl((String)((HashMap)list.get(0)).get("email"));
		tel_no = CommonUtil.nvl((String)((HashMap)list.get(0)).get("tel_no"));
		cell_no = CommonUtil.nvl((String)((HashMap)list.get(0)).get("cell_no"));
		
		ent_nm = CommonUtil.nvl((String)((HashMap)list.get(0)).get("ent_nm"));
		
	}
}


%>
<jsp:include page="/jsp/common/header.jsp"></jsp:include>
<script language='javascript' src="/js/ajaxutil.js"></script>
<script>
function go_modify(){
	var frm = document.mainform;
		
	frm.cmd.value='admin_select';
	frm.action = '/speaking.pb';
	frm.target= '_self';              
	frm.submit();	
}

function go_admin(){
	var frm = document.mainform;	
	frm.cmd.value='admin_main';
	frm.action = '/speaking.pb';
	frm.target= '_self';              
	frm.submit();	
}
function init_admin(){
	form = document.mainform;
	setSPSelect(form.ent_id,'<%=ent_id%>', '기업선택', 'ent');
}
//window.onload = init_admin;
</script>

<jsp:include page="/jsp/common/top.jsp"></jsp:include>
<jsp:include page="/jsp/common/submenu.jsp"><jsp:param name="submenu_id" value="admin_main" /><jsp:param name="submenu_idx" value="1" /></jsp:include>

<form name="mainform"  method="post" action = "/speaking.pb" >
	<div id="bodyContainer">
        <div id="contents">
          <jsp:include page="/jsp/common/submenu_list.jsp"><jsp:param name="submenu_id" value="admin_main" /><jsp:param name="submenu_idx" value="3" /></jsp:include>
          
          
          <div class="boxContainer">
            <dl title="관리자보기">
              <dt>관리자보기</dt>
            </dl>
            <table class="setupTb">
            
              <tr>
                <th>ID</th>
                <td><%= login_id %> </td>
              </tr>
              <tr>
                <th>이름</th>
                <td><%= login_name%></td>
              </tr>
              <tr>
                <th>비밀번호</th>
                <td><%= login_pw %></td>
              </tr>
               
              <%if(level.equals("1")){ %>
              <tr>
                <th>등급</th>
                <td>
                  <%=(admin_level.equals("1"))?"전체관리자":"" %>
                  <%=(admin_level.equals("2"))?"부운영자":"" %>
                  <%=(admin_level.equals("3"))?"기업관리자":"" %>
                  <%=(admin_level.equals("4"))?"Rater":"" %>
                  <%=(admin_level.equals("5"))?"기업회원관리자":"" %>
                </td>
              </tr>
              <input type="hidden" name="admin_level" id="admin_level" value="<%=admin_level %>" />
              <%}else{ %>
                <input type="hidden" name="admin_level" id="admin_level" value="<%=admin_level %>" />
              <%} %>
              <tr>
                <th>기업</th>
                <td><%=ent_nm %></td>
              </tr>
              <tr>
                <th>email</th>
                <td><%= email%></td>
              </tr>
              <tr>
                <th>연락처</th>
                <td><%= tel_no%></td>
              </tr>
              <tr>
                <th>휴대폰</th>
                <td><%= cell_no%></td>
              </tr>           
            </table>
            <p><a href="#" onclick="go_modify()"><img src="img/btn_modify.gif" alt="수정" width="49" height="20" /></a> <a href="#" onclick="go_admin()"><img src="img/btn_list.gif" alt="목록" width="49" height="20" /></a> </p>
            
          </div>
          
        </div>
      </div>


<input type="hidden" name="cmd" value="">
<input type="hidden" name="user_id" value="<%=user_id %>">
<input type="hidden" name="admin_id" value="<%=admin_id %>">
<input type="hidden" name="id_chk" value="N">

</form>

<iframe name='hidden_frm'  width='0' height='0' SCROLLING='AUTO' frameborder='0'></iframe>
<jsp:include page="/jsp/common/footer.jsp"></jsp:include>
<jsp:include page="/jsp/common/bottom.jsp"></jsp:include>
